#include <Game.h>

ICharacter::ICharacter()
{
	//
	mHealth = 100;
	mSpeed = 80.0f;
	mIsPunching = false;
	mIsMoving = false;
	mIsKicking = false;
	mIsAttacking = false;
	mAttackRange = 20.0;
	mGame = NULL;
	mLastTime = 0;
	mTimeUntilIdle = 0.0;
}

ICharacter::~ICharacter()
{
	//
}

int ICharacter::getHealth()
{
	return mHealth;
}

void ICharacter::setHealth(int h)
{
	mHealth = h;
}

void ICharacter::setPosition(float x, float y, float z)
{
	//
	mX = x;
	mY = y;
	mZ = z;
}

void ICharacter::setGame(Game* g)
{
	assert(g);
	mGame = g;
}

void ICharacter::setX(float x)
{
	mX = x;
}

void ICharacter::setY(float y)
{
	mY =y;
}

void ICharacter::setZ(float z)
{
	mZ = z;
}

bool ICharacter::moveForward()
{
	//
	
	return true;
}

bool ICharacter::moveBackward()
{
	return true;
}

bool ICharacter::moveLeft()
{
	return true;
}

bool ICharacter::moveRight()
{
	return true;
}

void ICharacter::punch()
{
	//
}

void ICharacter::kick()
{
	//
}

void ICharacter::update(float elapsed)
{
	//
}

bool ICharacter::isInRangeOf(ICharacter* c)
{
	//
	double d;
	double deltaX = (double) ( (double)c->mX - (double) mX);
	double deltaY = (double) ( (double)c->mY - (double) mY);
	double deltaZ = (double) ( (double)c->mZ - (double) mZ);
	d = sqrt( (deltaX * deltaX) + (deltaY * deltaY) + (deltaZ * deltaZ) );
	if ( d < mAttackRange )
	{
		return true;
	}
	
	return false;
}

bool ICharacter::isAttacking()
{
	return mIsAttacking;
}

bool ICharacter::isPunching()
{
	return mIsPunching;
}

bool ICharacter::isKicking()
{
	return mIsKicking;
}

bool ICharacter::isMoving()
{
	return mIsMoving;
}

bool ICharacter::isDead()
{
	return (mHealth <= 0);
}

void ICharacter::die()
{
	//
}



